﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Orchard.Model;

namespace Orchard.View
{
    public partial class FirewoodBox : UserControl
    {

        Lumber lumber;
        List<List<int>> pixelArray;
        public FirewoodBox()
        {
            InitializeComponent();
            lumber = new Lumber();
            pixelArray = new List<List<int>>();
            
            // Set the first index of the pixelArray to the width of the controller.
            pixelArray.Capacity = this.Width;
            // Set the second index of the pixelArray to the height of the controller.
            foreach (var firstIndex in pixelArray)
            {
                firstIndex.Capacity = this.Height;
            }

        }

        public void addTree(Tree tree)
        {
            // Add the new tree reference
            lumber.addTree(tree);

            // Update the UI to reflect the addition
            piecesOfFirewoodLabel.Text = lumber.Trees.Count.ToString();
        }
    }
}
